package ua.org.enginer.utils.time {
	
	import ua.org.enginer.utils.Maths;
	
	public function getTimestamp(date:Date, dateOnly:Boolean=false):String {
		var month:int = date.month+1;
		
		var timestamp:String = date.fullYear+"-"+Maths.toString(month, 2)+"-"+Maths.toString(date.date, 2);
		
		if (!dateOnly) timestamp += " "+Maths.toString(date.hours, 2)+":"+Maths.toString(date.minutes, 2)+":"+Maths.toString(date.seconds, 2)
		
		return timestamp;
	}
		
}